<mk-box [isRemovable]="false">
  <mk-box-header>
    <div class="btn-toolbar">
      <button class="btn btn-success" (click)="add()" *ngIf="user.me.level<2">添加传感器</button>
    </div>
  </mk-box-header>
  <mk-box-content>
    <div class="col-lg-12">
      <div class="table-responsive">
        <table class="table table-bordered">
          <thead>
          <tr>
            <th><input type="checkbox"></th>
            <th>ID</th>
            <th>传感器名称</th>
            <th>所属设备</th>
            <th>数据类型</th>
            <th>更新时间</th>
            <th>创建时间</th>
            <th>操作</th>
          </tr>
          </thead>
          <tbody>
          <tr *ngFor="let sensor of sensors">
            <td><input type="checkbox"></td>
            <td>{{sensor.id}}</td>
            <td>{{sensor.name}}</td>
            <td>{{sensor.deviceId}}</td>
            <td>{{sensor['dataTypeStr']}}</td>
            <td>{{sensor.updateTime}}</td>
            <td>{{sensor.createTime}}</td>
            <td>
              <div class="btn-toolbar" style="display: flex">
                <button class="btn btn-primary btn-xs" (click)="gotoData(sensor)">查看数据</button>
                <button class="btn btn-success btn-xs" (click)="edit(sensor)" *ngIf="user.me.level<2">编辑</button>
                <button class="btn btn-danger btn-xs" (click)="delete(sensor)" *ngIf="user.me.level<2">删除</button>
              </div>
            </td>
          </tr>
          </tbody>
        </table>
      </div>
    </div>
    <div class="col-lg-12">
      <div class="form-inline">
        <div class="form-group pull-right">
          <input class="form-control" type="button" value="上一页" [disabled]="page==1" (click)="goto(page-1)">
          <input class="form-control" style="width: 60px" type="text" [value]="page" #gotoPage>
          <span>{{' /'+maxPage+' '}}</span>
          <input class="form-control" type="button" value="前往" (click)="goto(gotoPage.value)">
          <input class="form-control" type="button" value="下一页" (click)="goto(page+1)">
        </div>
      </div>
    </div>
  </mk-box-content>
</mk-box>

